<include file="Public:header" />
<script type="text/javascript">
KindEditor.ready(function(K) {
	var editor1 = K.create('textarea[name="content"]', {
		uploadJson : "{:U('/Common/uploadEditor')}",
		allowFileManager : false,
		width : '700px',
		height : '300px'
	});
});
</script>
    <h3 class="title"><em>新增新闻</em><span><a href="{:U('index')}">返回列表&nbsp;&rsaquo;&nbsp;</a></span></h3>
	<div class="formbox">
    	<form name="mform" method="post" action="{:U('add')}" enctype="multipart/form-data">
		<table width="100%" border="0" cellspacing="1" cellpadding="0">
			<tr>
				<th>标题：</th>
				<td><input name="name" type="text" class="ipt" id="name" size="50" maxlength="50" /></td>
			</tr>
            <tr>
				<th>图片：</th>
				<td>
                <script type="text/javascript">
					KindEditor.ready(function(K) {
						var editor = K.editor({
							allowFileManager : true,
							uploadJson : "{:U('/Common/uploadEditor')}"
						});
						K('#imageBtn').click(function() {
							editor.loadPlugin('easyimage', function() {
								editor.plugin.imageDialog({
									//imageUrl : K('#url1').val(),
									clickFn : function(url, title, width, height, border, align) {
										//K('#url1').val(url);
										$("#imageUrl img").attr({src:url, alt:title});
										 $("#pic").val(url);
										$("#imageUrl").show();
										editor.hideDialog();
									}
								});
							});
						});
					});
				</script>
				<div id="imageUrl" class="imageUrl" <notempty name="info['pic']">style="display:block;"</notempty>>
				<empty name="info['pic']">
				<img align="absmiddle" width="100" />
				<else/>
				<img align="absmiddle" width="100" src="{$info['pic']}" />
				</empty>
				</div>
				<div class="clear"></div>
				<input type="text" name="pic" class="ipt" id="pic" value="{$info['pic']}" class="ipt" size="30" /><input type="button" id="imageBtn" value="插入图片" />
				</td>
			</tr>
            <tr>
				<th>分类：</th>
				<td>
                	<select name="cate_id" id="cate_id" class="sel">
                    	<option value="0">请选择分类</option>
                        {$cateOption}
                    </select>
                </td>
			</tr>
			<tr>
				<th>SEO标题：</th>
				<td><input name="title" type="text" class="ipt" id="title" size="50" maxlength="100" /><span class="tips">SEO标题长度建议在80个字符以内</span></td>
			</tr>
            <tr>
				<th>SEO关键字：</th>
				<td><input name="keywords" type="text" class="ipt" id="keywords" size="50" maxlength="100" /><span class="tips">SEO关键字长度建议在80个字符以内</span></td>
			</tr>
            <tr>
				<th>SEO描述：</th>
				<td><textarea name="description" cols="55" rows="8" class="ipt" id="description"></textarea><span class="tips">SEO描述长度建议在100个字符以内</span></td>
			</tr>
			<tr>
				<th valign="top">详情：</th>
				<td>
                <textarea name="content" cols="55" rows="8" class="ipt" id="content" style="width:700px; height:280px;"></textarea></td>
			</tr>
            <tr>
				<th>排序权重：</th>
				<td><input name="row_sort" type="text" class="ipt" id="row_sort" size="20" value="0" maxlength="5" /></td>
			</tr>
            <tr>
				<th>点击量：</th>
				<td><input name="vies" type="text" class="ipt" id="views" size="20" value="1" maxlength="5" /></td>
			</tr>
			<tr>
				<th>状态：</th>
				<td>
                	<label><input name="status" type="radio" checked="checked" value="1" /> 显示</label>
                	<label><input name="status" type="radio" value="2" /> 不显示</label>
                </td>
			</tr>
			<tr class="btnbox">
            	<th>&nbsp;</th>
				<td>
					<input type="submit" class="btn" value="保 存">&nbsp;
					<input type="reset" class="btn" value="取 消" onClick="window.location.href='{:U('index')}';">
				</td>
			</tr>
		</table>
        </form>
	</div>
<include file="Public:footer" />